package com.damai.error;

import java.io.PrintWriter;

import com.citywithincity.utils.JsonUtil;

/**
 * 外部使用的error
 * @author renxueliang
 *
 */
public class OuterError extends ApiError {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	private int code;
	
	public OuterError(int code,String error) {
		super(error);
		this.code = code;
	}
	
	@Override
	public void render(PrintWriter writer) {
		String result = JsonUtil.raw(code, getMessage());
		writer.print(result);
	}

	public int getCode() {
		return code;
	}

	public void setCode(int code) {
		this.code = code;
	}
}
